home *** CD-ROM | disk | FTP | other *** search
- var pNum = Number(this._name.slice(6,-3));
- var pState;
- var pX;
- var pY;
- var pSpeed;
- this.setPos = function(ty, tdir)
- {
- this._x = pX + 38;
- this._y = pY - ty;
- };
- this.onEnterFrame = function()
- {
- var _loc1_ = this;
- if(pState == "active")
- {
- pX += pSpeed;
- if(pX < 0 || pX > 740)
- {
- _loc1_.setUp();
- }
- else if(_loc1_.hitTest(_loc1_._parent.bod_mc.pete_mc.hitarea_mc))
- {
- _loc1_._parent.bod_mc.hitMe("bullet");
- _loc1_.setUp();
- }
- }
- };
- this.setUp = function()
- {
- var _loc1_ = this;
- _loc1_.pState = "idle";
- _loc1_.pX = -500;
- _loc1_.pY = 10 * pNum;
- };
- this.fire = function(x, y, dir)
- {
- pX = x;
- pY = y;
- pSpeed = dir;
- if(pSpeed > 0)
- {
- this._xscale = -100;
- }
- else
- {
- this._xscale = 100;
- }
- pState = "active";
- };
- this.setUp();
- stop();
-